<template>
<form>
  <div class="form-group">
    <label for="userName">标题</label>
    <div>{{info.title}}</div>
  </div>
  <div class="form-group">
    <label for="password">内容</label>
   <div>{{info.content}}</div>
  </div>
  <button id="cancel" type="button" @click="back" class="btn btn-default">Back</button>
</form>
</template>

<script>
import {get} from '../../utils/utils.js'
export default {
  data () {
    return {
      info:{
        title: '',
        content: ''
      }
    }
  },
  props: ['data'],
  mounted(){
    this.detail()
  },
  methods:{
    back(){
      this.$root.back()
    },
    async detail(){
      const res = await get(`/publish/detail/${this.data.id}`, {title:this.title, content:this.content})
      if(res.err!=1){
        this.info = res.info
      }
    },
    jump(compName, data){
      this.$root.chgComp(compName, data)
    }

  }
}
</script>

